package com.xiangxiao.rpan.authority.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.security.core.GrantedAuthority;

import java.io.Serializable;
import java.util.Date;

/**
 * @Projectname: walarm-authority
 * @author xiangxiao
 * email: 573768011@qq.com
 * date: 2022/11/4 10:16
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserRoleInfo implements Serializable, GrantedAuthority {
  private static final long serialVersionUID = 940870026317816190L;
  /**
   * 用户id
   */
  private Long userId;

  /**
   * 角色id
   */
  private Long roleId;

  /**
   * 角色名称
   */
  private String roleName;

  /**
   * 角色中文名
   */
  private String roleCnName;

  /**
   * 角色类型
   */
  private Integer type;


  /**
   * 角色等级
   */
  private Integer grade;

  /**
   * 操作权限
   */
  private String operateAuth;

  /**
   * 客户端web 0, app 1
   */
  private Integer clientType;

  @Override
  public String getAuthority() {
    return String.valueOf(roleId);
  }
}
